<script setup>
import {useRouter, useRoute} from "vue-router";
import {ref,onMounted,onBeforeUnmount} from "vue";
import TopBar from './components/TopBar.vue';

var router = useRouter()
var windowWidth = ref(window.innerWidth)
var windowHeight = ref(window.innerHeight)
var user =ref({
  id:'id',
  username:'username',
  password:'password',
  addTime:'addTime',
  sex:'sex',
  home:'home',
  identity:'identity',
})
onMounted(()=> {
  router.push('/login')
  window.addEventListener('resize', updateWindowSize);
});

onBeforeUnmount(() => {
  window.removeEventListener('resize', updateWindowSize);
});

const updateWindowSize = () => {
  windowWidth.value = window.innerWidth;
  windowHeight.value = window.innerHeight;
};

</script>

<template>
  <div :style="{ width: `${windowWidth}px` , height:`${windowHeight}px`}" >
<!--    <TopBar v-if="showTopBar"/>-->
<!--    <div id="page" >-->

      <!--      <div ref="vantaRef" style="width: 100%; height: 100%">-->
      <router-view/>
<!--    </div>-->
  </div>

</template>

<style>
#page{
    height: 100%;
    width: 100%;
    position: fixed;
    z-index: 1;
}
</style>
